add minimal PhISEM (Shaker) physical model#18
Draft
lfesp wants to merge 1 commit intospiricom:masterfrom
Draft
Conversation
lfesp
commented
Mar 29, 2024
| p->gain = gain; | ||
| } | ||
|
|
||
| void tShaker_setResonance (tShaker *const pm, Lfloat freq, Lfloat radius) { |
Author
There was a problem hiding this comment.
I think that getting rid of the resonator field entirely, and instead returning the direct output p->level * tNoise_tick(&p->noise) on each tick, would make for a better API. This is fine because there's no feedback.
If we let the user handle the filtering/resonance, they can set up and modify as many resonating stages as they like (which is used on almost all of Cook's PhISEM presets), and we don't have to expose a wrapper to tBiQuad_setResonance for tShaker.
Owner
|
Thanks, Liam! I’ll check this over. I need to think about whether the
resonant filter should be included in the model or be a separate thing
Composer, musician, instrument designer
scattershot.org * @snyderphonics
…On Fri, Mar 29, 2024 at 2:17 PM Liam Esparraguera ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In leaf/Src/leaf-physical.c
<#18 (comment)>:
> + p->soundDecay = decay;
+}
+
+void tShaker_setProbability (tShaker *const pm, Lfloat prob)
+{
+ _tShaker* p = *pm;
+
+ // set gain correction for number of particles
+ float nBeans = 1024.0 * prob;
+ float gain = (log(nBeans) / log(4.)) * (40/nBeans);
+
+ p->probability = prob;
+ p->gain = gain;
+}
+
+void tShaker_setResonance (tShaker *const pm, Lfloat freq, Lfloat radius) {
I think that getting rid of the resonator field entirely, and instead
returning the direct output p->level * tNoise_tick(&p->noise) on each
tick, would make for a better API. This is fine because there's no feedback.
If we let the user handle the filtering/resonance, they can set up and
modify as many resonating stages as they like (which is used on almost all
of Cook's PhISEM presets), and we don't have to expose a wrapper to
tBiQuad_setResonance for tShaker.
—
Reply to this email directly, view it on GitHub
<#18 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGAY7GIYORFUPHAFNP2RJDY2WV2XAVCNFSM6AAAAABFOYBG2GVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNRZGI3DCMZWHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a minimal implementation of Perry Cook's PhISEM model, a statistically-derived physical model for particle synthesis.
Issue: this implementation is not complete, as there is an issue with the BiQuad filtering. However, switching to a tSVF as the model's resonator works correctly.